home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / ghostscr / gsview07.zip / gsview.doc < prev    next >
Text File  |  1993-05-10  |  29KB  |  730 lines

  1. 1Overview
  2. ?Overview
  3.  `Ghostview for Windows` is a graphical interface for MS-Windows `Ghostscript`.
  4.  Ghostscript is an interpreter for the PostScript page description language
  5.  used by laser printers.
  6.  For documents following the Adobe PostScript Document Structuring
  7.  Conventions, Ghostview for Windows allows selected pages to be viewed or
  8.  printed.
  9.  Ghostview for Windows can be used with Windows Ghostscript 2.6 or later.
  10.  Ghostview for Windows was inspired by Tim Theisen's X11 Ghostview
  11.  program.
  12.  The ability to understand `DSC` comments comes from X11 Ghostview.
  13.  
  14. 2Document Structuring Conventions
  15. ?Document Structuring Conventions
  16. ?DSC
  17. ?Encapsulated PostScript
  18. ?EPSF
  19. ?EPS
  20.  Adobe has defined a set of extended comment conventions that provide
  21.  additional information about the page structure and resource
  22.  requirements of a postscript file.
  23.  If a file contains these Document Structuring Convention (DSC) comments,
  24.  Ghostview can display pages in random order using `Goto` and display pages
  25.  in reverse order using `Prev`.  Selected pages can be extracted to
  26.  another file or printed.
  27.  
  28.  If a file does not contain DSC comments, Ghostview can only
  29.  display the pages in the original order.
  30.  
  31.  DSC conforming files start with the comment line:
  32.   %!PS-Adobe-3.0
  33.  where the number 3.0 may change and is the DSC version number.
  34.  Some programs write postscript files with a control-D as the first
  35.  character of the file, followed by the comment line mentioned above.
  36.  Ghostview will correctly report that these files are not DSC conforming,
  37.  but will still display them with page selection features available.
  38.  Complain to the author of the program that produced the postscript file.
  39.  To make the file DSC conforming, edit it to remove the control-D character.
  40.  
  41.  DSC conforming files contain lines such as:
  42.   %%Pages: 24
  43.   %%Page: 1 1
  44.  These lines tell Ghostview how many pages a document contains and
  45.  where they start.  Ghostview uses this information to select
  46.  individual pages.
  47.  
  48.  Encapsulated PostScript Files (EPSF) are single page documents
  49.  that contain a subset of the `DSC` comments and PostScript commands.
  50.  EPS files start with the comment line:
  51.   %!PS-Adobe-3.0 EPSF-3.0
  52.  EPS files are commonly used for inclusion in other documents and
  53.  for this reason require the bounding box comment:
  54.    %%BoundingBox: llx lly urx ury
  55.  where llx, lly, urx and ury are integers giving the x and y coordinates
  56.  of the lower left and upper right corners of a bounding box which encloses
  57.  all marks made on the page.
  58.  
  59.  Some EPS files contain a preview of the postscript document.
  60.  This preview can be a Windows Metafile, a TIFF file, or an Interchange
  61.  preview (EPSI format).
  62.  For the Windows Metafile or TIFF file preview, the EPS file under DOS
  63.  contains a binary header which specifies the location and lengths of
  64.  the preview and postscript language sections of the EPS file.
  65.  For the Interchange format, the preview is contained in DSC comments
  66.  starting with
  67.   %%BeginPreview: width height depth lines
  68.  An EPS file with a preview can be created from an EPS file without a
  69.  preview using `Add EPS Preview`
  70. 2Opening a Document
  71. ?File
  72. ?Open
  73. ?Select File
  74.  The `Open` command on the `File` menu opens a file and displays
  75.  the first page.
  76.  
  77.  If the file contains `DSC` comments, pages can be selected using
  78.  `Next`, `Prev` and `Goto`.
  79.  
  80.  If the file does not contain `DSC` comments, `Prev` and `Goto` will
  81.  not work.  Another file should not be selected until a last page of
  82.  the file has been displayed.
  83.  
  84.  When a file is open, Ghostview will display the document filename,
  85.  the current page (if available) and while the cursor is over
  86.  the image, the location of the cursor in default user coordinates
  87.  (1/72 inch).
  88.  The cursor location is useful for calculating bounding boxes.
  89.  
  90.  The `Select File` command is similar to `Open` but it does not display
  91.  the document.
  92.  This command is useful for opening a document prior to printing it.
  93.  
  94.  See also `Print`.
  95. 2Page Selection
  96. ?Page Selection
  97. ?Next
  98. ?Prev
  99. ?Redisplay
  100. ?Goto
  101.  `Next` moves to the next page of a document.
  102.  This works even if the document does not contain `DSC` comments.
  103.  
  104.  `Prev` moves to the previous page.
  105.  
  106.  `Redisplay` redisplays the current page.
  107.  
  108.  `Goto` shows a dialog box which allows selection of the next page
  109.  number to display.  The `Select Page` dialog box shows page labels
  110.  since these are likely to be more useful than a sequential page number.
  111.  
  112.  The `Prev`, `Redisplay` and `Goto` commands work only if the
  113.  document contains `DSC` comments.
  114. 2Document Information
  115. ?Info
  116.  A brief information area at the top of the window is used by
  117.  Ghostview to display the document filename, the current page number
  118.  and label (if available) and while the cursor is over the image, the
  119.  location of the cursor in default user coordinates (1/72 inch).
  120.  The cursor location is useful for calculating bounding boxes.
  121.  
  122.  The `Info` command on the `File `menu shows a dialog box with the
  123.  following information about the `DSC` comments in the current document.
  124.  
  125.  `File `is the full pathname to the document.
  126.  
  127.  `Type` is` DSC`,` EPS` or `No DSC comments`.
  128.  `EPS` is an Encapsulated PostScript File - a single page document
  129.  that contains a subset of the `DSC` comments and PostScript commands.
  130.  `EPS `files are commonly used for inclusion in other documents.
  131.  
  132.  `Title` is a text title that can be used when printing banner
  133.  pages and for routing or recognising documents.
  134.  
  135.  `Date` is the time the document was created.
  136.  
  137.  `BoundingBox` specifies a box that encloses all the marks painted
  138.  on the page.  The four values are the coordinates of the lower left
  139.  and upper right corners of the bounding box in default user
  140.  coordinates (1/72 inch).
  141.  
  142.  `Orientation `is either `Portrait `or` Landscape`.
  143.  
  144.  `Default Media` gives the media name followed by the width and
  145.  height of that media in default user coordinates (1/72 inch).
  146.  
  147.  `Page Order` is either `Ascending`, `Descending` or `Special`
  148.  
  149.  `Pages` is the total number of pages in the document.
  150.  
  151.  `Page` gives the page label and page number.
  152.  
  153.  `Bitmap `is the size of the display bitmap in pixels which may be
  154.  useful if you are copying the displayed image to the clipboard.
  155. 2Printing
  156. ?Print
  157. ?Print To File
  158. ?Print File
  159. ?Extract
  160.  The `Print` command on the `File `menu allows printing of the document
  161.  using Ghostscript.
  162.  The Ghostscript printer driver and resolution are selected using the
  163.  `Select Device` dialog box.   Pages are selected using the `Select Pages`
  164.  dialog box.  The `All`, `Odd` and `Even` buttons provide quick selection
  165.  of pages.
  166.  
  167.  The `mswinprn` printer driver uses the windows printer drivers
  168.  and should work with any printer with raster capabilities.
  169.  Printer resolution cannot be selected from within Ghostview; use
  170.  the Control Panel instead.  This driver is very slow.
  171.  
  172.  With all other printer drivers, Ghostscript sends the output direct
  173.  to the printer, without passing through a Windows printer driver.
  174.  If you have trouble printing you may have to `Print To File`
  175.  and then `Print File` or use the DOS command `COPY /B FILENAME PRN`.
  176.  
  177.  This list of available devices and resolutions is stored in the
  178.  [Devices] section of gsview.ini.  The default list of devices
  179.  and resolutions is taken from the standard distribution version
  180.  of Ghostscript for Windows 2.6 and may not be complete.
  181.  
  182.  To print a document without displaying it, open the document
  183.  using `Select File`.
  184.  
  185.  `Print To File` is similar to the `Print` command except that Ghostscript
  186.  will write the output to a file instead of sending it to a printer.
  187.  
  188.  If you want to produce a bitmap, some useful drivers are
  189.  `bmpmono`, `bmp16`, `bmp16m` and `bmp256`.
  190.  
  191.  `Print File` sends a file to a local port, bypassing the Windows
  192.  printer drivers.
  193.  This is useful for sending a document to a PostScript printer,
  194.  or for sending an output file produced by Ghostscript to a printer.
  195.  
  196.  `Extract` allows a range of pages to be copied from the current
  197.  document to a new document.  For example, ten pages can be extracted
  198.  from the middle of the current document and written to another file,
  199.  which will later be sent to a printer.
  200.  
  201. 3Properties
  202. ?Properties
  203.  Some printer drivers allow extra properties to be specified.
  204.  If two sections are added to the gsview.ini file for these printer
  205.  drivers, Ghostview will enable the `Properties` button which will
  206.  display the `Edit Properties` dialog box.
  207.  The following example shows how to add property information
  208.  for the cdjcolor driver.
  209.  First add a section which gives the current values.
  210.  This section, after the first character is removed, gives the options
  211.  that will appear in the `Property` list box.
  212.  The first character is `s` for string or `d` for number.
  213.   [cdjcolor]
  214.   dBitsPerPixel=24
  215.   dDepletion=1
  216.   dShingling=2
  217.   dBlackCorrect=4
  218.  
  219.  Next add a section which gives the values to display in the
  220.  `Value` list box.
  221.   [cdjcolor values]
  222.   dBitsPerPixel=1,3,8,16,24
  223.   dDepletion=1,2,3
  224.   dShingling=0,1,2
  225.   dBlackCorrect=0,1,2,3,4,5,6,7,8,9
  226.  Ghostview will also add the value `[Not defined]` to the listbox.
  227.  
  228.  When you press the `OK` button in the `Edit Properties` dialog
  229.  box, the current settings are written to the gsview.ini file.
  230.  
  231.  When Ghostview prints a file, it will give Ghostscript the contents
  232.  of the [cdjcolor] section of gsview.ini as follows:
  233.   -dBitsPerPixel=24 -dDepletion=1 -dShingling=2 -dBlackCorrect=3
  234.  If the value of a property is `[Not defined]`, that property will
  235.  not be sent to Ghostscript.
  236.  
  237.  Some entries for the cdj family of drivers are supplied in the
  238.  property.ini file that comes with Ghostview.
  239. 3PS to EPS
  240. ?PS to EPS
  241.  In general, it is not possible to convert a PostScript file to `EPS`.
  242.  However, many single page PostScript files can be converted to `EPS`
  243.  by changing the first line of the file to
  244.   %!PS-Adobe-3.0 EPSF-3.0
  245.  and then adding or fixing up the `%%BoundingBox` comment.
  246.  
  247.  To convert a PostScript file to `EPS`, the original file `must` be
  248.  `single page` document.  If the document contains `DSC` comments
  249.  and is multi page, extract the desired page with `File` | `Extract`.
  250.  If the document does not contain `DSC` comments, you will need to
  251.  edit the file by hand to extract the desired page.
  252.  
  253.  `EPS` documents `must not` use any of the following operators:
  254.   banddevice   clear         cleardictstack  copypage
  255.   erasepage    exitserver    framedevice     grestoreall
  256.   initclip     initgraphics  initmatrix      quit
  257.   renderbands  setglobal     setpagedevice   setpageparams
  258.   setshared    startjob      letter          note
  259.   legal        a3            a4              a5
  260.  
  261.  The following operators should be used with care:
  262.   nulldevice   setgstate     sethalftone    setmatrix
  263.   setscreen    settransfer   setcolortransfer
  264.  
  265.  It is `your` responsibility to make sure that the above requirements
  266.  are met.
  267.  
  268.  To test if a document contains any of the above operators, select
  269.  `Options` | `EPS Warn` and then `Open` the desired document.
  270.  After the page has been displayed, look in the Ghostscript text window.
  271.  If any of the above operators have been used you should see lines like:
  272.   Warning: EPS files must not use ...
  273.  If you find these warnings then do `not` use `PS to EPS`.
  274.  Remember to turn off `EPS Warn` afterwards.
  275.  
  276.  A document must be displayed before `PS to EPS` is used.
  277.  The document must contain a `showpage`.
  278.  This is required so that the bounding box can be measured.
  279.  
  280.  For documents without `DSC` comments, `PS to EPS` allows a bounding
  281.  box to be specified, then writes out an `EPS` file consisting of
  282.  an `EPS` wrapper around the original document.
  283.  
  284.  For documents with `DSC` comments, `PS to EPS` will change the
  285.  first line of the file to
  286.   %!PS-Adobe-3.0 EPSF-3.0
  287.  then allows the `%%BoundingBox` comment to be changed or added.
  288.  
  289.  For `EPS` documents, `PS to EPS` allows the `%%BoundingBox` comment to
  290.  be changed.
  291.  
  292.  See also `Add EPS Preview`, `Extract`, `EPS Warn`.
  293. 2Clipboard
  294. ?Clipboard
  295. ?Edit
  296. ?Copy
  297. ?Paste To
  298. ?Convert Bitmap
  299. ?Bitmap
  300. ?Add EPS Preview
  301. ?Extract EPS
  302.  The Ghostview window can be copied to the Clipboard as a bitmap
  303.  by selecting `Copy` from the `Edit` menu.
  304.  The bitmap may be a Device Independent Bitmap or it may be a Device
  305.  Dependent Bitmap, depending on how Ghostscript was compiled.
  306.  The default for Ghostscript 2.6 is a Device Independent Bitmap
  307.  (BMP format).
  308.  
  309.  An alternative way to get a bitmap output from Ghostscript is
  310.  to use one of the BMP drivers.  See `Print`.
  311.  
  312.  `Paste To` copies a Device Independent Bitmap from the Clipboard
  313.  (if available) to a BMP file.
  314.  
  315.  `Convert Bitmap` converts between a Device Independent Bitmap and
  316.  a Device Dependent Bitmap.
  317.  If the clipboard contains a Device Independent Bitmap (BMP format),
  318.  this is converted to a Device Dependent Bitmap and added to the clipboard.
  319.  If the clipboard does not contain a colour palette, one is created
  320.  from the Device Independent Bitmap and added to the clipboard.
  321.  This option is present because some applications (notably Windows
  322.  Paintbrush) won't recognise a Device Independent Bitmap in the clipboard.
  323.  
  324.  `Add EPS Preview` takes a bitmap from the clipboard and uses it to add
  325.  a preview to an EPS file.
  326.  `Add EPS Preview` can create a DOS EPS file with a Windows Metafile or
  327.  TIFF preview, or an EPSI file with an Interchange preview.
  328.  To use the `Add EPS Preview` command the following steps must be followed.
  329.  Select `Orientation` | `Portrait`.  Select `Options` | `EPS Clip`.
  330.  Select `Media` | `Resolution` and set a suitable resolution for the preview.
  331.  `Open` an EPS file that does not contain a preview.  Select `Edit` | `Copy`.
  332.  Select `Edit` | `Add EPS Preview`, then the preview format,
  333.  then the new EPS filename.  
  334.  If adding an Interchange preview, the document must have an `%%EndComments`
  335.  line, otherwise Ghostview may put the preview in the wrong place.
  336.  
  337.  To extract the PostScript or Preview section from a DOS EPS
  338.  file, use `File` | `Select File` followed by `Edit` | `Extract EPS`
  339.  then `PostScript` or `Preview`.
  340.  
  341.  See also `PS to EPS`.
  342. 2Options
  343. ?Options
  344.  The `Options` menu has the following selections
  345. 3Ghostscript Command
  346. ?Ghostscript Command
  347.  The `Ghostscript Command` option allows selection of the command
  348.  to use when executing Ghostscript.  The default is `gswin`.
  349.  If Ghostscript is not in the Ghostview directory, or not on the
  350.  PATH, use this option to set the full pathname to Ghostscript.
  351.  If you wish to specify that Ghostscript should look for its
  352.  initialisation files in a different place, add a -I option to
  353.  the command as in the following example:
  354.   c:\gs\gswin -Ic:\gs;d:\psfonts
  355.  Try to keep the command length short, otherwise Ghostview will
  356.  have trouble printing files with Ghostscript.
  357.  Only the Ghostscript EXE and include path may be specified -
  358.  other items will confuse Ghostview.
  359. 3Sounds
  360. ?Sounds
  361.  The `Sounds` option assigns sounds to various events.
  362.  For each event the sound can be set to `None`, a `Speaker Beep` or
  363.  a `Wave` file.
  364.  
  365.  You must have a sound driver loaded before using Wave files.
  366.  Wave file sounds are not available under Windows 3.0.
  367.  
  368.  The events are:
  369.  
  370.  `Output Page`: the PostScript showpage operator was executed.
  371.  
  372.  `No Page`: an invalid page was selected.
  373.  For example, pressing `Prev` while on the first page of a document
  374.  with `DSC` comments.
  375.  
  376.  `No Number`: a command required page numbering and the document did
  377.  not have page numbering.
  378.  For example, pressing `Goto` when viewing a document without
  379.  `DSC` comments.
  380.  
  381.  `Not Open`:  a command required a document to be open and this was
  382.  not the case.
  383.  For example, pressing `Goto` when no document is open.
  384.  
  385.  `Error`: many types of errors.
  386.  
  387.  `Timeout`: no response from Ghostscript within a timeout period.
  388.  For example, display snowflak.ps on a PC with a 286-12 CPU.
  389.  
  390.  `Start`: Ghostview opened.
  391.  
  392.  `Exit`: Ghostview closed.
  393.  
  394.  The defaults are for `No Page` and `Error` to be a `Speaker Beep`
  395.  and all other events to be `None`.
  396. 3Save Settings
  397. ?Save Settings
  398. ?Settings
  399. ?INI file
  400. ?Save Settings on Exit
  401.  The `Save Settings` option saves the Ghostview window position,
  402.  window size, last used printer, `User Defined`, `Ghostscript Command`,
  403.  `Button Bar`, `Quick Open`, `Auto Redisplay`, `EPS Clip`, `EPS Warn`,
  404.  `Sounds`, `Orientation`, `Media` and `Resolution` options to the file
  405.  gsview.ini in the windows directory.
  406.  Ghostview reads gsview.ini during startup.
  407.  
  408.  When the `Save Settings on Exit` option is checked, Ghostview will
  409.  automatically save the above settings when you quit Ghostview.
  410. 3Save Last Directory
  411. ?Save Last Directory
  412.  When the `Save Last Directory` option is `checked`, Ghostview will
  413.  save the current directory when you quit Ghostview.  When Ghostview
  414.  is started next, this will be made the current directory.
  415.  This is the default.
  416.  
  417.  When `Save Last Directory` option is `unchecked`, the current
  418.  directory when Ghostview is started will be the directory where
  419.  Ghostview is located, or the working directory specified by
  420.  the Program Manager.
  421. 3Button Bar
  422. ?Button Bar
  423.  When the `Button Bar` option is `checked`, Ghostview will display
  424.  a Button Bar down the left side of the window.  This is the default.
  425.  The Button Bar contains the following items:
  426.  
  427.  `File` | `Open`
  428.  
  429.  `File` | `Print`
  430.  
  431.  `File` | `Info`
  432.  
  433.  `Help` | `Contents`
  434.  
  435.  `File` | `Goto`
  436.  
  437.  `File` | `Next`
  438.  
  439.  `File` | `Prev`
  440.  
  441.  `Go forward 5 pages`
  442.  
  443.  `Go back 5 pages`
  444.  
  445.  When the `Button Bar` option is `unchecked`, Ghostview will not
  446.  display the Button Bar.
  447. 3Quick Open
  448. ?Quick Open
  449.  When the `Quick Open` option is `checked`, Ghostview will not reload
  450.  Ghostscript before every document, making opening of documents quicker.
  451.  
  452.  Ghostview tries to preserve the Ghostscript state between documents,
  453.  but a document may still leave the Ghostscript interpreter in an unusual
  454.  state or cause an error.  If an error occurs, Ghostscript will close.
  455.  Error messages are displayed in the Ghostscript window.
  456.  Select `Redisplay` to reopen the document.
  457.  
  458.  If `Quick Open` is `unchecked`, Ghostview will close Ghostscript and
  459.  restart it before each new document or whenever the page orientation,
  460.  resolution or size is changed.
  461. 3Auto Redisplay
  462. ?Auto Redisplay
  463.  When the `Auto Redisplay` option is `checked`, Ghostview will
  464.  redisplay `DSC` documents when the `Orientation`, `Resolution`
  465.  or `Media` are changed.
  466.  
  467.  If `Auto Redisplay` is `unchecked`, the `File` | `Redisplay` command
  468.  must be used to redisplay a document after changing the
  469.  `Orientation`, `Resolution` or `Media`.  This is the default.
  470. 3EPS Clip
  471. ?EPS Clip
  472.  When the `EPS Clip` option is `checked`, Ghostview will clip the
  473.  display bitmap to the bounding box of an EPS file instead of using the
  474.  page size specified on the `Media` menu.  This is useful when
  475.  adding a bitmap preview to an EPS file.
  476.  
  477.  If `EPS Clip` is `unchecked`, Ghostview will use the page size
  478.  specified on the `Media` menu for EPS files.  This is the default.
  479.  
  480.  See also `Clipboard` | `Add EPS Preview`
  481. 3EPS Warn
  482. ?EPS Warn
  483.  When the `EPS Warn` option is `checked`, Ghostview will write a
  484.  prolog to Ghostscript when each file is opened.  This prolog will
  485.  produce warning messages in the Ghostscript text window if any
  486.  PostScript operators that should not be used in `EPS` files
  487.  are used.  An example warning message is:
  488.   Warning: EPS files must not use /initgraphics
  489.  `EPS Warn` is not infallible.  It is possible to access restricted
  490.  operators without `EPS Warn` producing a warning.
  491.  
  492.  The default for `EPS Warn` is `unchecked`.
  493.  
  494.  See also `PS to EPS`.
  495. 2Page Orientation
  496. ?Orientation
  497. ?Portrait
  498. ?Landscape
  499. ?Upside-down
  500. ?Seascape
  501. ?Swap Landscape
  502.  The `Portrait`, `Landscape`, `Upside-down` and `Seascape`
  503.  (reverse Landscape) commands on the `Orientation `Menu select
  504.  the page orientation used by the display.
  505.  `Landscape` implies a clockwise rotation of the paper by 90 degrees.
  506.  `Seascape` implies an anti-clockwise rotation of the paper by 90 degrees.
  507.  These orientation options only affect the display and do not affect
  508.  the print commands.
  509.  If a `DSC` page orientation comment is found, the orientation will be
  510.  selected automatically.
  511.  
  512.  When the `Swap Landscape` option is `checked`, Ghostview swaps the
  513.  meaning of Landscape and Seascape.
  514.  Most of the Landscape documents that I have encountered require a 90
  515.  clockwise rotation of the paper to view.
  516.  However, there is no standard and some documents need to be rotated
  517.  the other way.
  518.  The `Swap Landscape` button allows Ghostview to automatically rotate the
  519.  document the right way in response to the `%%Orientation` comment in the
  520.  PostScript file.
  521. 2Page Size and Display Resolution
  522. ?Resolution
  523. ?Media
  524. ?Page Size
  525. ?User Defined
  526.  The `Resolution` command on the `Media` menu selects the display
  527.  resolution in dots per inch.
  528.  The default for a VGA display is 96 dots per inch.
  529.  
  530.  The `Media` menu also allows selection of page size.
  531.  Available page sizes are:
  532.   Letter          8.5 x 11   inch
  533.   Tabloid        11   x 17   inch
  534.   Ledger         17   x 11   inch
  535.   Legal           8.5 x 14   inch
  536.   Statement       5.5 x  8.5 inch
  537.   Executive       7.5 x 10   inch
  538.   A3              297 x 420  mm
  539.   A4              210 x 297  mm
  540.   A5              148 x 210  mm
  541.   B4              257 x 364  mm
  542.   B5              182 x 257  mm
  543.   Folio           8.5 x 13   inch
  544.   Quarto          8.5 x 10.8 inch
  545.   10x14          10   x 14   inch
  546.  
  547.  A user defined size can be specified in PostScript points (1/72 inch)
  548.  with the `User Defined` command.  A size of 480x360 points at 96 dpi
  549.  will give an image size of 640x480 pixels.
  550.  
  551.  If a `DSC` media comment is found, the page type will be selected
  552.  automatically.  If the media specification is not one of the above
  553.  page types, the `User Defined` size will be set.
  554. 2Running Ghostview from the File Manager
  555. ?Registration Info Editor
  556. ?File Manager
  557.  To run Ghostview when a PostScript file is double clicked in the
  558.  File Manager, the following sequence must be followed to teach
  559.  File Manager about PostScript files.
  560.  
  561.  From the `Program Manager`, run the Registration Info Editor using
  562.  `File `| `Run...` then type `regedit`.
  563.  From the `Registration Info Editor` select `Edit `| `Add File Type...`
  564.  then enter the following fields:
  565.   Identifier = psfile
  566.   Filetype = PostScript
  567.   Action = Open
  568.   Command = gsview %1
  569.   Uses DDE = unchecked
  570.   Action = Print
  571.   Command = gsview /p %1
  572.   Uses DDE = unchecked
  573.  Then press `OK`.
  574.  
  575.  From the `File Manager`, select `File `| `Associate` then
  576.  enter the following fields:
  577.   Files with Extension = ps
  578.   Associate With = PostScript (gsview)
  579.  Then press `OK`.
  580.  
  581.  That's it!  Now when you double click on a PostScript file,
  582.  the `File Manager` will run Ghostview.  When you drop a PostScript
  583.  file on the `Print Manager`, Ghostview will print the file.
  584. 2Copyright
  585. ?Copyright
  586.  The `About` menu item shows the Ghostview copyright message
  587.  and Ghostview version number.
  588.  
  589.   GSVIEW.EXE - A Ghostscript graphical interface
  590.   Copyright (C) 1993  Russell Lang
  591.  
  592.  This program is free software; you can redistribute it and/or modify
  593.  it under the terms of the GNU General Public License as published by
  594.  the Free Software Foundation; either version 2 of the License, or
  595.  (at your option) any later version.
  596.  
  597.  This program is distributed in the hope that it will be useful,
  598.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  599.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  600.  GNU General Public License for more details.
  601.  
  602.  You should have received a copy of the GNU General Public License
  603.  along with this program; if not, write to the Free Software
  604.  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  605.  
  606.      Author: Russell Lang
  607.    Internet: rjl@monu1.cc.monash.edu.au
  608.  
  609.  ps.c module Copyright (C) 1992 Tim Theisen (tim@cs.wisc.edu).
  610. 2Common Problems
  611. ?Problems
  612.  `Problem:` Ghostview can't run gswin.
  613.  
  614.  From the Ghostview menu select `Options` | `Ghostscript Command`
  615.  and enter the correct executable path and include path for Ghostscript.
  616.  For example:
  617.   c:\gs\gswin.exe -Ic:\gs
  618.  
  619.  The default Ghostscript Command is `gswin`.  This will work if
  620.  Ghostscript is in the same directory as Ghostview, or if the
  621.  Ghostscript directory is on the PATH.
  622.  
  623.  Make sure you don't already have Windows Ghostscript running.
  624.  Only one copy of Windows Ghostscript can be running at a time.
  625.  Only one copy of Ghostview can be running at a time.
  626.  
  627.  `Problem:` Ghostscript starts and then immediately exits with error code 1.
  628.  
  629.  Read the error message in the Ghostscript window before pressing OK
  630.  in the message box.
  631.  
  632.  Ghostscript probably couldn't find its initialisation files.
  633.  Set the environment variable GS_LIB to the directory containing
  634.  the Ghostscript initialisation files, or add -Idirectory to the command
  635.  in `Options` | `Ghostscript Command`.
  636.  
  637.  Read the file use.doc that comes with Ghostscript.
  638.  
  639.  `Problem:` Message Box says `Incompatible Ghostscript`
  640.  
  641.  You probably have an earlier version of Ghostscript.
  642.  Make sure you have Ghostscript version 2.6 or later.
  643.  
  644.  `Problem:` Ghostview says 'wait' and shows an hourglass cursor.
  645.  When the cursor is moved off the Ghostview window it changes to a
  646.  normal arrow.
  647.  
  648.  The above state is normal while Ghostview is waiting for Ghostscript
  649.  to do something.  It may be that the document is very complex and
  650.  Ghostscript is just taking a long time.  In this state it is safe to
  651.  resize or scroll the window, but do not select any menu commands.
  652.  
  653.  If this is not the case then Ghostview probably got no response
  654.  from Ghostscript.
  655.  Open the Ghostscript text window and look at the error message.
  656.  Close Ghostscript using the Ghostscript system menu.
  657.  If Ghostview is still waiting, press the Ghostview Open button
  658.  (even though the cursor is still an hourglass).
  659.  Press the 'Yes' button on the 'gsview is busy' message box.
  660.  Ghostview should then revert to the non-waiting mode.
  661. 2Internals
  662. ?Internals
  663.  The preferred method for driving Ghostscript would be to start it
  664.  as a child process and then to send it postscript code through a pipe.
  665.  Windows 3.1 supports neither child processes nor pipes.
  666.  
  667.  Ghostview interacts with Ghostscript by sending messages between
  668.  the Ghostview and Ghostscript windows.
  669.  Ghostview creates an imitation pipe to Ghostscript by writing
  670.  into a shareable global memory block and then passing the handle
  671.  to Ghostscript.
  672.  
  673.  Ghostview starts Ghostscript for displaying using
  674.   gswin -rXDPIxYDPI -gWIDTHxHEIGHT -sGSVIEW=xxxx -
  675.  where xxxx is the handle to the Ghostview window.
  676.  Ghostscript then tells Ghostview the handle to the text window by sending
  677.  a message WM_USER with wParam HWND_TEXT=0 to the Ghostview window.
  678.  Instead of creating another window for the image, Ghostscript
  679.  creates a child window of the Ghostview window for displaying
  680.  the bitmap. Ghostscript tells Ghostview the handle to this child
  681.  image window by sending a message WM_USER with wParam
  682.  HWND_IMGCHILD=1.
  683.  
  684.  Ghostscript also sends WM_USER messages to Ghostview with wParam
  685.  GSWIN_CLOSE=2 when it is exiting,
  686.  SYNC_OUTPUT=3 when the image needs to be redrawn (win_sync_output),
  687.  OUTPUT_PAGE=4 when a page is to be output (win_output_page),
  688.  SCROLL_POSITION=5 when the window is scrolled and
  689.  PIPE_DATA=6 for passing the handle to a global memory block (in
  690.  lParam) for the imitation pipe.
  691.  
  692.  When Ghostscript sends the OUTPUT_PAGE command it waits until it
  693.  receives a NEXT_PAGE command from Ghostview.
  694.  
  695.  Ghostview sends WM_USER messages to the Ghostscript Image window with
  696.  wParam NEXT_PAGE=10 when it is time to move to the next page and
  697.  COPY_CLIPBOARD=11 when the bitmap should be copied to the clipboard.
  698.  Ghostview sends WM_USER messages to the Ghostscript Text window with
  699.  wParam PIPE_REQUEST=12 when it wants more pipe data.
  700.  
  701.  Ghostview uses temporary files of the name gsviewXX.XXX in the
  702.  directory given by the TEMP environment variable.
  703.  Keep TEMP short to avoid the gswin command line exceeding 128 characters.
  704.  
  705.  Ghostview starts Ghostscript for printing using
  706.   gswin -sGSVIEW=xxxx @optfile filename.ps quit.ps
  707.  optfile contains
  708.   -dNOPAUSE
  709.   -sDEVICE=devname
  710.   -rXDPIxYDPI
  711.   -gWIDTHxHEIGHT
  712.   -sOutputFile=filename
  713.  
  714.  To start Ghostview and display filename.ps use:
  715.   gsview filename.ps
  716.  To start Ghostview and print filename.ps using Ghostscript use:
  717.   gsview /P filename.ps
  718.  To start Ghostview and print filename.ps to a file using Ghostscript use:
  719.   gsview /F filename.ps
  720.  To start Ghostview in debug mode use:
  721.   gsview /D
  722.  In debug mode Ghostview will `not` remove its temporary files.
  723.  This is to allow inspection of these files after Ghostview has finished.
  724.  
  725.  The ability to select individual pages for an Adobe Document
  726.  Structuring Conventions conforming document is due to the inclusion of
  727.  the ps.c module from X11 Ghostview by Tim Theisen (ghostview@cs.wisc.edu).
  728.  Don't sent mail to Tim about Ghostview for Windows, unless it is about a
  729.  bug in the ps.c module.
  730.